<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>事件绑定</title>
    <script>
        function f1(){
            console.log("这是静态绑定事件")
        }
    </script>
</head>
<body>
<button onclick="f1()">静态绑定</button><br>
<button id="btn">动态绑定</button><br>
<script>
    document.getElementById("btn").onclick = function(){
        console.log("这是动态绑定事件")
    }
</script>
</body>
</html>